    package com.study.yield;

    public class YieldTest {
        public static void main(String[] args) {
            Yield yield = new Yield();
            new Thread(yield,"a").start();
            new Thread(yield,"b").start();
        }
    }
    class  Yield implements Runnable{
        @Override
        public void run() {
            System.out.println(Thread.currentThread().getName()+"执行前");
            Thread.yield();
            System.out.println(Thread.currentThread().getName()+"执行后");
        }
    }
